/**
 * 
 */
package jvs.peer.net;

import java.io.IOException;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;

/**
 * @author qiangli
 * 
 */
public class PeerURLStreamHandler extends URLStreamHandler {

	/**
	 * 
	 */
	public PeerURLStreamHandler() {
	}

	@Override
	protected URLConnection openConnection(URL u) throws IOException {
		URLConnection c =  new PeerURLConnection(u);
		c.connect();
		return c;
	}

	@Override
	protected URLConnection openConnection(URL u, Proxy p) throws IOException {
		throw new IOException("not supported");
	}
	
}
